//
//  UIBarButtonItem+My.m
//  My00
//
//  Created by 黄杰 on 15/1/27.
//  Copyright (c) 2015年 黄杰. All rights reserved.
//

#import "UIBarButtonItem+My.h"

@implementation UIBarButtonItem (My)

#pragma mark -  添加barButtonItem按钮
+ (UIBarButtonItem *)addBarButtonItemViewWithName:(NSString *)name highName:(NSString *)highName addTarget:(id)target action:(SEL)action
{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setBackgroundImage:[UIImage imageNamed:name] forState:UIControlStateNormal];
    btn.bounds = (CGRect){CGPointZero, btn.currentBackgroundImage.size};
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    return [[UIBarButtonItem alloc] initWithCustomView:btn];
}

@end
